# -*- coding: utf-8 -*-
#Importamos un conjunto de modulos y funciones
from django.conf.urls.defaults import *
from django.contrib import admin
import os

#Realizamos tareas
PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0]) #Asignamos dinamicamente a esta variable el path del proyecto
admin.autodiscover() #Habilitamos la funcion de manejo del admin

#Definimos patron de reconocimiento de urls
urlpatterns = patterns('',
	#Urls a nuestras aplicaciones!
	(r'^', include('mundofacu.portal.urls')),
	(r'^usr/',include('mundofacu.usuarios.urls')),
	(r'^news/',include('mundofacu.news.urls')),
	(r'^foro/',include('mundofacu.foro.urls')),
	(r'^voice/',include('mundofacu.voice.urls')),
	#Urls del admin
	(r'^admin/', include(admin.site.urls)),
)
#Urls que agrego fisa al pack general para que reconozca la carpeta dominio/doc y la haga funcionar dinamicamente...
urlpatterns += patterns('',
		   (r'^doc/$', 'django.views.generic.simple.redirect_to',{'url':'/doc/index.html'}),
		   (r'^doc/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.join(PROJECT_PATH,'doc'), 'show_indexes': True}),
)
#Servidor estatico de archivos :D
urlpatterns += patterns('',
		   (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.join(PROJECT_PATH,'static'), 'show_indexes': True}),
)
